# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ruby-test-unit-ruby-core
_gemname=test-unit-ruby-core
pkgver=1.0.5
pkgrel=0
pkgdesc="Additional test assertions for Ruby standard libraries"
url="https://github.com/ruby/test-unit-ruby-core"
arch="noarch"
license="BSD-2-Clause AND Ruby"
depends="ruby"
makedepends="ruby-rdoc"
subpackages="$pkgname-doc"
source="https://github.com/ruby/test-unit-ruby-core/archive/v$pkgver/$_gemname-$pkgver.tar.gz"
builddir="$srcdir/$_gemname-$pkgver"
options="!check"  # no tests provided

build() {
	gem build $_gemname.gemspec
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"

	gem install \
		--local \
		--install-dir "$gemdir" \
		--ignore-dependencies \
		--document ri \
		--verbose \
		$_gemname

	# Remove unnessecary files
	cd "$gemdir"
	rm -rf build_info cache extensions plugins
}

doc() {
	pkgdesc="$pkgdesc (ri docs)"

	amove "$(ruby -e 'puts Gem.default_dir')"/doc
}

sha512sums="
5f107cc054abfa422c5a82c58b4a67de4c6c6cf60a0c3e18cc8408162cff5dd1689e1c61cff4900635f09b8ba908ec4394c2b5ef7e072c3eb4759463dc4b4f90  test-unit-ruby-core-1.0.5.tar.gz
"
